Page({
  data: {
    group: require('../../config/enum')['sourceGroup'],
    type: require('../../config/enum')['feedback'],
    detail: null,
  },
  onLoad: function (options) {
    wx.util.request('user.feekback.detail', {
      query: `id=${options.id}`
    }).then(detail => {
      detail.createdAt = wx.time.toDate(detail.created_at);
      detail.updatedAt = wx.time.toDate(detail.updated_at);
      this.setData({
        detail: detail
      });
    });
  },
  preview: function (e) {
    let covers = this.data.detail.covers;
    wx.previewImage({
      urls: covers,
      current: covers[e.currentTarget.dataset.index]
    });
  }
})